//using ServiceManager;
using Lcygcc.Infrastructure.WindowService;
using System;
using System.ComponentModel;
using System.IO;
using System.ServiceProcess;
namespace Lcygcc.WindowService.Daemon
{
	public class Service : ServiceBase
	{
		private ServiceDaemon ServiceDaemon;
		private IContainer components;
		public Service()
		{
			this.InitializeComponent();
		}
		protected override void OnStart(string[] args)
		{
			WindowsService windowsService = new WindowsService();
			windowsService.Name = "Lcygcc.CenterService.Host";
			windowsService.ProcessName = "";
			windowsService.Path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Lcygcc.WindowService.Host.exe");
			windowsService.Description = "Lcygcc中心服务";
			this.ServiceDaemon = new ServiceDaemon();
			this.ServiceDaemon.Start(windowsService);
		}
		protected override void OnStop()
		{
			this.ServiceDaemon.Stop();
		}
		protected override void Dispose(bool disposing)
		{
			if (disposing && this.components != null)
			{
				this.components.Dispose();
			}
			base.Dispose(disposing);
		}
		private void InitializeComponent()
		{
			this.components = new Container();
			base.ServiceName = "Service1";
		}
	}
}
